/**
 * 直播带货根据产品信息跳转详情页
 * @param {*} prodInfo
 * @param {*} goodsRoomId
 */
function getRecommendDetailRouter(prodInfo, goodsRoomId = '') {
  let goPath = '';
  let pathQuery = {};
  if (goodsRoomId) {
    pathQuery.goodsRoomId = goodsRoomId;
  }
  switch (prodInfo.subProdType * 1) {
    case 1: //vip
    case 23: //svip
    case 31: //拼团vip
    case 32: //拼团svip
      if (!prodInfo.vipInfo) {
        goPath = '/member/vip/vipUp';
        break;
      }
      if (prodInfo.relationType == global.relationTypeMap.collage) {
        goPath = '/homePage/collage/vipCollage';
        pathQuery.prodId = prodInfo.vipInfo.id;
        pathQuery.isCollage = true;
        break;
      }
      if (prodInfo.relationType == global.relationTypeMap.flashSales) {
        goPath = '/member/vip/vipUp';
        pathQuery.prodId = prodInfo.vipInfo.id;
        pathQuery.pId = prodInfo.vipInfo.marketID;
        pathQuery.type = prodInfo.subProdType == 1 ? global.ckFrom.flashSalesVip : global.ckFrom.flashSalesSvip;
        break;
      }
      goPath = '/member/vip/vipUp';
      pathQuery.prodId = prodInfo.vipInfo.id;
      pathQuery.type = prodInfo.subProdType == 1 ? global.ckFrom.vip : global.ckFrom.svip;
      break;
    case 5: //课程
    case 30: //课程
    case 66: //限时购课程
      const COURSE_MAP = {
        0: "video",
        1: "voice",
        2: "imgText"
      };
      let fromType = prodInfo.subProdType == 5 ? global.ckFrom.course : global.ckFrom.flashSalesCourse;
      let type = prodInfo.relationType == global.relationTypeMap.flashSales || prodInfo.relationType == global.relationTypeMap.collage ? COURSE_MAP[prodInfo.courseType] : COURSE_MAP[prodInfo.voiceStatus];
      goPath = `/homePage/course/${type}`;
      pathQuery.courseId = prodInfo.subMsgId;
      pathQuery.ckFrom = fromType;
      pathQuery.extId = -1;
      break;
    case 36:
    case 7:
      goPath = '/activity/activityDetail';
      pathQuery.ActivityNo = prodInfo.subMsgId;
      pathQuery.from = 'activity';
      break;
    case 8:
      goPath = '/homePage/datum/datumDetail';
      pathQuery.datumId = prodInfo.subMsgId;
      break;
    case 9:
    case 29:
    case 67:
      goPath = '/homePage/column/columnDetail';
      let columnFrom = prodInfo.subProdType == 9 ? global.ckFrom.column : global.ckFrom.flashSalesColumn;
      pathQuery.extId = prodInfo.subMsgId;
      pathQuery.ckFrom = columnFrom;
      pathQuery.cId = -1;
      break;
    case 10:
      goPath = '/homePage/socialGroup/socialGroupInfo';
      pathQuery.SocialRoomId = prodInfo.subMsgId;
      break;
    case 11:
    case 71:
      goPath = '/homePage/examination/examinationDetail';
      pathQuery.ExaminationNo = prodInfo.subMsgId;
      break;
    case 12: //商城
    case 13: //独立商城
      goPath = '/mall/shopDetail/shopDetail';
      pathQuery.shopNo = prodInfo.subMsgId;
      break;
    case 41:
      goPath = '/homePage/clockIn/clockInDetail';
      pathQuery.clockInId = prodInfo.subMsgId;
      break;
    case 61:
    case 48:
    case 70:
      goPath = '/homePage/package/packageDetail';
      pathQuery.combosId = prodInfo.subMsgId;
      break;
    case 51:
    case 72:
      goPath = '/homePage/live/liveDetail';
      pathQuery.liveId = prodInfo.subMsgId;
      break;
    case 53:
      goPath = '/activity/activityDetail';
      pathQuery.ActivityNo = prodInfo.subMsgId;
      pathQuery.from = 'reservation';
      break;
    case 56:
      goPath = '/homePage/word/wordDetail';
      pathQuery.dId = prodInfo.subMsgId;
      break;
    case 68:
    case 69:
      goPath = '/homePage/collage/vipCollage';
      pathQuery.prodId = prodInfo.subMsgId;
      pathQuery.isSales = true;
      break;
    case 75:
      goPath = '/homePage/mutuaTest/mutuaTestDetail';
      pathQuery.mutuaTestId = prodInfo.subMsgId;
      break;
    case 76:
      goPath = '/homePage/form';
      pathQuery.relId = prodInfo.subMsgId;
      pathQuery.relType = 2;
      pathQuery.type = 2;
      break;
    case 77:
      goPath = '/homePage/voiceTest/voiceTestDetail';
      pathQuery.paperMainId = prodInfo.subMsgId;
      break;
    case 78:
      goPath = '/homePage/camp/campDetail';
      let subProdId = (prodInfo.relationType == global.relationTypeMap.flashSales || prodInfo.relationType == global.relationTypeMap.collage) ? prodInfo.subMsgId : prodInfo.subProdId;
      pathQuery.campId = subProdId;
      pathQuery.ckFrom = global.ckFrom.camp;
      break;
    case 86:
      goPath = '/homePage/booking/bookingTime';
      pathQuery.atId = prodInfo.subMsgId;
      pathQuery.ckFrom = global.ckFrom.booking;
      break;
    case 104: //拼团分销
      goPath = '/homePage/column/columnDetail';
      pathQuery.extId = prodInfo.subMsgId;
      pathQuery.ckFrom = prodInfo.subProdType;
      pathQuery.courseId = -1;
      pathQuery.distribution = 1;
      break;
    case 116: //面授课
      goPath = '/edu/eduDetail';
      pathQuery.id = prodInfo.subMsgId;
      break;
  }
  return {
    goPath,
    pathQuery
  }
}

export {
  getRecommendDetailRouter
}
